package com.haoshuang.zhouzhoubang.ui.page.area

import com.haoshuang.zhouzhoubang.databinding.ItemCityBinding
import com.haoshuang.zhouzhoubang.model.bean.CityBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.gone
import com.mufeng.libs.utils.view.visible


/**
 *  城市列表适配器
 * @param data 列表数据
 * @param type 列表条目类型判定 0隐藏成员状态（默认隐藏） 1 显示成员状态
 * */
class CityListAdapter(data: MutableList<CityBean>) :
    BaseBindingQuickAdapter<CityBean, ItemCityBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: CityBean?) {
        val binding = ItemCityBinding.bind(holder.itemView)
        binding.apply {
            tvName.text = item?.name
            if (item?.isCheck == 0) {
                tvCheck.gone()
            } else {
                tvCheck.visible()
            }

        }
    }

}